gadget: Fix handling of custom content
authorMatthias Clasen <mclasen@redhat.com>
Sun, 7 Aug 2016 00:02:49 +0000 (20:02 -0400)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 18 Oct 2016 10:49:13 +0000 (11:49 +0100)
The transformations here were wrong, causing content to go nowhere.
This patch fixes check and radio buttons to appear as expected.

gtk/gtkcssgadget.c

index b89c41b424695a46e97eeb6df9050731bc9d0ffe..edfc271bb14e0b0f8fa6a6b72468395ecd208d69 100644 (file)
@@ -909,7 +909,7 @@ gtk_css_gadget_get_render_node (GtkCssGadget  *gadget,
       graphene_point3d_t tmp;
 
       graphene_matrix_init_translate (&content_transform,
-                                      graphene_point3d_init (&tmp, -contents_x, -contents_y, 0));
+                                      graphene_point3d_init (&tmp, contents_x, contents_y, 0));
 
       /* If there's an override in place, create a temporary node */
       if (gadget_class->has_content (gadget))
@@ -925,7 +925,7 @@ gtk_css_gadget_get_render_node (GtkCssGadget  *gadget,
 
           /* Compatibility mode: draw_focus is left to the draw() implementation */
           draw_focus = gadget_class->draw (gadget, cr,
-                                           contents_x, contents_y,
+                                           0, 0,
                                            contents_width, contents_height);
 
           g_free (str);